home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
ptv1n6.arc
/
INPUT.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-01-21
|
546b
|
16 lines
; Listing 2. INPUT.ASM.
; The input() method as pure assembly language
push bp ; Create stack frame
mov bp, sp
push si ; Must save si register
mov si, word ptr [bp+4] ; Point to object data with si
mov ax, word ptr [bp+6] ; Load AX with i
add word ptr [si],ax ; sum += i
inc word ptr [si+2] ; n++
pop si ; Restore si register
pop bp ; Remove the stack frame
ret ; Return to caller